//------------------------------------------------------------------------------
// <copyright file="CheckUpdatesCompletedEventArgs.cs" company="Damian Antonowicz">
//       copyright © 2010 Damian Antonowicz
// </copyright>
// <author>Damian Antonowicz</author>
// <email>poczta@damianantonowicz.pl</email>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace DAnton.Blocks.Updater
{
    public class CheckUpdatesCompletedEventArgs : AsyncCompletedEventArgs
    {
        #region private members

        bool updatesAvailable;
        Version latestVersion;

        #endregion

        #region properties

        public bool UpdatesAvailable
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return this.updatesAvailable;
            }
        }

        public Version LatestVersion
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return this.latestVersion;
            }
        }

        #endregion

        #region constructors

        public CheckUpdatesCompletedEventArgs(bool available, Version latestVersion)
            : base(null, false, null)
        {
            this.updatesAvailable = available;
            this.latestVersion = latestVersion;
        }

        public CheckUpdatesCompletedEventArgs(Exception ex, bool cancelled)
            : base(ex, cancelled, null)
        {
        }

        #endregion
    }
}
